Imports System.Data.SqlClient

Public Class OrdenesDeTrabajo
    Public Function GenerarOT(ByVal Fec, ByVal Can, ByVal Obs)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "OrdenDeTrabajoGenerar", New SqlParameter("@Fec", Fec), _
        New SqlParameter("@Can", Can), New SqlParameter("@Obs", Obs))
        Return DS
    End Function

    Public Function ModificarOT(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "OrdenesDeTrabajoModificar", New SqlParameter("@CodOT", Dat(1)), _
        New SqlParameter("@Can", Dat(2)), New SqlParameter("@CodOT", Dat(3)))
        Return DS
    End Function

    Public Function ObtenerOT(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "OrdenesDeTrabajoObtener", New SqlParameter("@CodOT", Dat(0)))
        Return DS
    End Function

    Public Function GenerarIOT(ByVal CodOT, ByVal CodIPP, ByVal IOT, ByVal Fec, ByVal Obs)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeOTGenerar", New SqlParameter("@CodOT", CodOT), _
        New SqlParameter("@CodIPP", CodIPP), New SqlParameter("@IOT", IOT), New SqlParameter("@Fec", Fec), _
        New SqlParameter("@Obs", Obs))
        Return DS
    End Function

    Public Function ObtenerIOT(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeOTObtener", New SqlParameter("@CodOT", Dat(0)))
        Return DS
    End Function

    Public Function ModificarIOT(ByVal CodIOT)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeOTModificar", New SqlParameter("@CodIOT", CodIOT))
        Return DS
    End Function

    Public Function EliminarIOT(ByVal CodIOT)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDeOTEliminar", New SqlParameter("@CodIOT", CodIOT))
        Return DS
    End Function

End Class
